package com.day0913;

import java.util.Scanner;

public class Text3_4 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[] scores = new int[5];
        int sum = 0;
        double avgScore;
        for(int i = 0; i < scores.length; i ++){
            System.out.println("请输入第" + (i+1) + "个学生的成绩：");
            scores[i] = in.nextInt();
            sum += scores[i];
        }
        int maxScore = scores[0];
        int minScore = scores[0];
        for (int i = 0; i < scores.length; i ++){
            if (scores[i] > maxScore){
                maxScore = scores[i];
            }
            if (scores[i] < minScore){
                minScore = scores[i];
            }
        }
        avgScore = sum / 5;
        System.out.println("总成绩为：" + sum);
        System.out.println("最高分为：" + maxScore);
        System.out.println("最低分为：" + minScore);
        System.out.println("平均分为：" + avgScore);
    }
}
